LotusScript Doc

Class: InstanceCollection

Manages a collection of instances of a modell class that is provided in the constructor. The goodies are

Version:
2.0.0, 28.MAR.2000
History:
28.MAR.2000EScReworked for docu standards



Property Summary
Public Property Get Count As Variant
Public Property Get IsSorted As Variant
Public Property Get Query As Variant

Method Summary
Function GetFirstInstance () As Variant
Function GetNextInstance () As Variant
Function GetNthInstance (N As Integer) As Variant
Sub LookUp (Database As Variant, View As Variant, Key As String)
Sub New (id As String, ModelObject As Variant)
Sub Search (Database As Variant, QueryObject As Variant)
Sub Sort ()

Property Detail

Public Property Get Query AsVariant

Gives the query used to select the elements for the collection. In case of a lookup, an artificial query including the viewname and key is created like "lookup 'myview' by 'mykey'"

Returns:
Variantwhich is a text with the query.
Summmary Top

Public Property Get Count AsVariant

Counts the number of elements in the collection. The result is 0 if the collection does not have elements.

Returns:
VariantNumber of elements in the collection
Summmary Top

Public Property Get IsSorted AsVariant

provides an indicator if the collection is sorted. The collection may be sorted if the view is sorted or if the sort has explicitely created a sort order.

Returns:
Variantwhich is true or false
See also:
LSALibOCIColl.InstanceCollection#Sort
Summmary Top
Method Detail

New

Public Sub New(id As String,ModelObject As Variant)
The constructor initializes the collection and making the MODELINSTANCE known. This model provides the capability to clone the instances managed in this collection . It also sets the ID, which will become the suggested name, that is made unique by a number. After initialization the collection does not contain any elements. You first ned to search or lookup elements.

Parameters:
IDStringthe name of the instances.
ModelObjectVariantthat is the MODELINSTANC managed by that collection
See also:
LSALibOCIColl.InstanceCollection#GetFirstInstance
Summmary Top

GetFirstInstance

Public Function GetFirstInstance As Variant
The first instance of the collection is provided or NOTHING if no elements is found.

Returns:
Variantwhich a clone of the MODELINSTANCE
Summmary Top

GetNextInstance

Public Function GetNextInstance As Variant
The next instance of the collection is provided. It progresses in a random order and returns NOTHING if no further elements are found.

Returns:
Variantwhich a clone of the MODELINSTANCE
Summmary Top

GetNthInstance

Public Function GetNthInstance(N As Integer) As Variant
Returns the Nth instance of the collection. This requires the collection to be sorted. If the collection is not sorted it will always return NOTHING.

Parameters:
indexIntegerpointing to the instance to be retrieved
Returns:
Variantwhich a clone of the MODELINSTANCE
See also:
LSALibOCIColl.InstanceCollection#Sort
Summmary Top

Search

Public Sub Search(Database As Variant,QueryObject As Variant)
Fills the collection with the instances found by the search.
Example:
Lets have a collection of keyword references that point to to a keyword definition. Lets assume we want to process the collection of keyword references for update. In this case the model would be the keyword reference and the queryObject would be the keyword definition. In this case the search would ask the query to provide a proper query that finds all those instances refered to by the defining queryObject.

Parameters:
DatabaseVarianta NOTESDATABASE or parent database is used
QueryObjectVariantQueryObject as ANYINSTANCE or String
Summmary Top

LookUp

Public Sub LookUp(Database As Variant,View As Variant,Key As String)
Fills the collection with the instances in the view.
CAUTION:
Make sure that the key finds the right documents that the instance can work upon!

Parameters:
DatabaseVariantusually a NOTESDATABASE or parent database is used
ViewVarianta NOTESVIEW, or a Viewname in the database
KeyStringthe Key to be looked for.
Summmary Top

Sort

Public Sub Sort
Sorts the collection. The sortkey isprovided by the each instance by the 'getSortstring' method. This method is required for sorting.
CAUTION:
this may be extreemly time consuming for larger collections!

See also:
LSALibOCIColl.InstanceCollection#GetIsSorted
Summmary Top

TopLotusScript Doc
© Lotus Professional Services
generated on : 05-Apr-01 10:01:44 AM